package org.grayrabbit.cms.entity;

// Generated 2011-5-16 13:39:30 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

/**
 * CmsRole generated by hbm2java
 */
@Entity
@Table(name = "CMS_ROLE")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Role implements java.io.Serializable {

	private static final long serialVersionUID = 7767759559905502331L;
	private String roleId;
	private String roleName;
	private Boolean activeStatus;
	private String memo;
	private Date createTime;
	private String createLoginName;
	private String createRealName;
	private String updateLoginName;
	private String updateRealName;
	private Date updateTime;
	
	//二期
	private String roleRange;//角色是全局角色？站点角色？全局（-1）站点（站点ID）
	// end
	
	private Set<Category> categories = new HashSet<Category>(0);
	private Set<RoleOperRela> roleOperRelas = new HashSet<RoleOperRela>(
			0);
	private Set<Admin> admins = new HashSet<Admin>(0);

	public Role() {
	}

	public Role(String roleId) {
		this.roleId = roleId;
	}

	@Id
	@Column(name = "ROLE_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")  
	public String getRoleId() {
		return this.roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	@Column(name = "ACTIVE_STATUS", precision = 1, scale = 0)
	public Boolean getActiveStatus() {
		return this.activeStatus;
	}

	public void setActiveStatus(Boolean activeStatus) {
		this.activeStatus = activeStatus;
	}

	
	@Column(name = "ROLE_NAME", length = 32)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@Column(name = "MEMO", length = 256)
	public String getMemo() {
		return this.memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME", length = 7)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "CREATE_LOGIN_NAME", length = 64)
	public String getCreateLoginName() {
		return this.createLoginName;
	}

	public void setCreateLoginName(String createLoginName) {
		this.createLoginName = createLoginName;
	}

	@Column(name = "CREATE_REAL_NAME", length = 64)
	public String getCreateRealName() {
		return this.createRealName;
	}

	public void setCreateRealName(String createRealName) {
		this.createRealName = createRealName;
	}

	@Column(name = "UPDATE_LOGIN_NAME", length = 64)
	public String getUpdateLoginName() {
		return this.updateLoginName;
	}

	public void setUpdateLoginName(String updateLoginName) {
		this.updateLoginName = updateLoginName;
	}

	@Column(name = "UPDATE_REAL_NAME", length = 64)
	public String getUpdateRealName() {
		return this.updateRealName;
	}

	public void setUpdateRealName(String updateRealName) {
		this.updateRealName = updateRealName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATE_TIME", length = 7)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "roles")
	public Set<Category> getCategories() {
		return this.categories;
	}

	public void setCategories(Set<Category> categories) {
		this.categories = categories;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "role")
	public Set<RoleOperRela> getRoleOperRelas() {
		return this.roleOperRelas;
	}

	public void setRoleOperRelas(Set<RoleOperRela> roleOperRelas) {
		this.roleOperRelas = roleOperRelas;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "role")
	public Set<Admin> getAdmins() {
		return this.admins;
	}

	public void setAdmins(Set<Admin> admins) {
		this.admins = admins;
	}

	@Column(name = "ROLE_RANGE", length = 32)
	public String getRoleRange() {
		return roleRange;
	}

	public void setRoleRange(String roleRange) {
		this.roleRange = roleRange;
	}

	
	
}
